package lanou3g.com.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import lanou3g.com.Fragment.Main_Fragment;

/**
 * Created by dllo on 2015/10/28.
 */
public class Main_Adapter extends FragmentPagerAdapter{

    private String[] titles = {"主页","美食","个人"};

    public Main_Adapter(FragmentManager fm) {
        super(fm);
    }

    /**
     * Return the Fragment associated with a specified position.
     *
     * @param position
     */
    @Override
    public Fragment getItem(int position) {
        return Main_Fragment.newInstance(position);
    }

    /**
     * Return the number of views available.
     */
    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
